package com.wn.sk.order.client;

import com.wn.common.api.Result;
import com.wn.sk.feign.dto.OrderDto;
import com.wn.sk.feign.dto.OrderPayDto;
import com.wn.sk.feign.vo.OrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author yellow Docter
 * @date 2022 -11-10
 * @desc
 *  远程调用 feign
 *  1、添加依赖
 */

@FeignClient("order-service")
public interface OrderFeignClient {

    @PostMapping("order")
    public Result<String> createOrder(@RequestBody OrderDto orderDto);

    @GetMapping("order/{orderSn}")
    public Result<OrderVo> findOrderByOrderSn(@PathVariable("orderSn") String  orderSn);

    /**
     * 付款成功后修改订单状态
     * @param orderPayDto
     * @return
     */
    @PutMapping("order/update")
    Result<String> updateOrder(@RequestBody OrderPayDto orderPayDto);
}
